<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>博文分类</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">
</head>
<body>
    <!--导航-->
    <nav th:replace="_fragments :: menu(2)" class="ui  inverted attached segment m-padded-tb-mini m-shadow-small">
        <div class="ui container">
            <div class="ui inverted secondary stackable menu">
                <h2 class="ui blue header item">鄭氏博客</h2>
                <a href="#" class="m-item item m-mobile-hide"><i class="ui red  home icon"></i>我的首页</a>
                <a href="#" class="active m-item item m-mobile-hide"><i class="green sitemap icon"></i>博文分类</a>
                <a href="#" class="m-item item m-mobile-hide"><i class="purple tags icon"></i>博文标签</a>
                <a href="#" class="m-item item m-mobile-hide"><i class="teal clone icon"></i>博文归档</a>
                <a href="#" class="m-item item m-mobile-hide"><i class="brown info circle icon"></i>与吾有关</a>
                <div class="m-item right item m-mobile-hide">
                    <div class="ui icon inverted transparent input">
                        <input type="text" placeholder="请输入想要搜索的......">
                        <i class="teal searchengin link icon"></i>
                    </div>
                </div>
            </div>
        </div>
        <a href="" class="ui menu toggle black icon button m-right-top m-mobile-show"> <i class="sidebar icon"></i></a>
    </nav>
    <!--中间部分-->
    <div class="m-container m-padded-tb-large">
        <!--header头部-->
        <div class="ui top attached segment ">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <h3 class="ui green header "><i class="sitemap icon"></i>博文分类</h3>
                </div>
                <div class="right aligned column">
                    有 <h2 class="ui pink header m-inline-block m-text-thin" th:text="${#arrays.length(types)}"> 999 </h2>个
                </div>
            </div>
        </div>
        <!--分类展示-->
        <div class="ui attached segment m-padded-tb-large animated fadeInLeft">
            <span th:text="${message}"></span>
            <div class="ui labeled button m-margin-tb-tiny" th:each="type : ${types}">
                <a href="" th:href="${type.id == activeTypeId} ? 'javascript:void(0);' : @{/types/{id}(id=${type.id})}" class="ui button"
                   th:classappend="${type.id==activeTypeId} ? 'purple'">
                    <i class="heart icon" th:classappend="${type.id==activeTypeId} ? 'red'"></i>[[${type.name}]]
                </a>
                <div class="ui basic left pointing label"
                     th:classappend="${type.id==activeTypeId} ? 'teal'"
                     th:text="${#arrays.length(type.blogs)}">255</div>
            </div>
            <!--/*-->
            <div class="ui labeled button m-margin-tb-tiny">
                <a href="" class="ui button"><i class="heart icon"></i>MYSQL</a>
                <div class="ui basic left pointing label">255</div>
            </div>
            <!--*/-->
        </div>
        <!--博文列表-->
        <div class="ui orange top attached  segment animated fadeInUp">
            <span th:text="${isTypeNull}"></span>
            <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                <div class="ui stackable grid" >
                    <div class="five wide column">
                        <a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" >
                            <img th:src="@{${blog.firstPicture}}" src="https://picsum.photos/id/237/800/400" style="height: 106px;width: 202px" alt="" class="ui rounded image">
                        </a>
                    </div>
                    <div class="eleven wide column">
                        <h3 class="ui header"><a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black" th:text="${blog.title}">你应该负起你的责任来</a></h3>
                        <p class="m-text" th:text="|${blog.description}......|">如果你有能力去解决问题,而不行动,那一但有坏事发生就是你的责任!如果你有能力去解决问题,而不行动,那一但有坏事发生就是你的责任!如果你有能力去解决问题,而不行动,那一但有坏事发生就是你的责任!如果你有能力去解决问题,而不行动,那一但有坏事发生就是你的责任!</p>
                        <div class="ui stackable grid">
                            <div class="eleven wide column">
                                <div class="ui small horizontal link list">
                                    <div class="item">
                                        <img th:src="@{${blog.user.avatar}}" src="https://picsum.photos/id/237/120/120" alt="" class="ui avatar image">
                                        <div class="content"><a href="" target="_blank" th:href="@{/about}" class="header" th:text="${blog.user.nickname}">鄭搜索</a>
                                        </div>
                                    </div>
                                    <div class="item">
                                        <i class="calendar alternate outline icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy年MM月dd日 HH:mm:ss')}"></span>
                                    </div>
                                    <div class="item">
                                        <i class="blue eye icon"></i><span th:text="${blog.views}">1024</span>
                                    </div>
                                    <div class="item">
                                        <i class="pink comment alternate icon"></i><span th:text="${blog.comments}">1024</span>
                                    </div>
                                </div>
                            </div>
                            <div class="right aligned five wide column">
                                <a href="javascript:void(0);"  class="ui purple basic m-padded-tiny m-text-thin"><i class="purple eyedropper icon"></i><span th:text="${blog.type.name}"></span></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!--底部footer-->
        <div class="ui bottom attached segment" th:if="${page.totalPages} > 1">
            <div class="ui middle aligned one column grid">
                <div class="column">
                    <!--首页-->
                    <a th:href="@{?(page=0)}" th:if="${page.number!=0}" class="item" th:unless="${page.first}">
                        <i class="blue arrow left icon"></i>
                    </a>
                    <!--上一页-->
                    <a th:href="@{?(page=${page.number}-1)}"  class="item" th:unless="${page.first}">
                        <i class="blue chevron left icon"></i>
                    </a>
                    <!--判断当前页-->
                    <th:block th:each="i : ${#numbers.sequence(1,page.totalPages)}">
                        <a th:href="@{?(page=${i}-1)}" th:if="${(page.number+1) != i}"
                           th:text="${i}" th:classappend="${page.number+1 == i} ? 'active blue' : ''"
                           class="ui button mini">3
                        </a>
                        <a th:if="${(page.number+1) eq i}"
                           th:text="${i}" th:classappend="${page.number+1 == i} ? 'active blue' : ''"
                           class="ui button mini ">3
                        </a>
                    </th:block>
                    <!--下一页-->
                    <a th:href="@{?(page=${page.number}+1)}"  class="item" th:unless="${page.last}">
                        <i class="blue chevron right icon"></i>
                    </a>
                    <!--尾页-->
                    <a th:href="@{?(page=${page.totalPages}-1)}" th:attr="data-page=${page.totalPages}-1"
                       class="item" th:unless="${page.last}">
                        <i class="blue arrow right icon"></i>
                    </a>
                </div>
            </div>
        </div>
    </div>
    </div>
    <!--底部footer-->
    <footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-big">
        <div class="ui center aligned container">
            <div class="ui inverted divided stackable grid">
                <div class="two wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">微信</h4>
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../static/images/wx.jpg" alt="" class="ui rounded image" style="width: 90px">
                        </div>
                    </div>
                </div>
                <div class="two wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">微博</h4>
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../static/images/wb.jpg" alt="" class="ui rounded image" style="width: 90px">
                        </div>
                    </div>
                </div>
                <div class="two wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">公众号</h4>
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../static/images/gzh.jpg" alt="" class="ui rounded image" style="width: 90px">
                        </div>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">最新博文</h4>
                    <div class="ui inverted link list">
                        <a href="" class="item">开发工具</a>
                        <a href="" class="item">开发工具</a>
                        <a href="" class="item">开发工具</a>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">与吾联系</h4>
                    <div class="ui inverted link list">
                        <a href="javascript:void (0);" class="item">Email：1775825464@qq.com</a>
                        <a href="javascript:void (0);" class="item">QQ：1775825464</a>
                    </div>
                </div>
                <div class="four wide column">
                <h4 class="ui inverted header">吾之自白</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">如果你有能力去解决问题,而不行动,那一但有坏事发生就是你的责任!</p>
                <p class="m-text-thin m-text-spaced m-opacity-mini">With great power,with great responsibility!</p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="m-text-thin m-text-spaced m-opacity-tiny" style="color: olive">Copyright © 2020 by 鄭氏</p>
        </div>
    </footer>
    <!--/*/<th:block th:replace="_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
    <!--/*/</th:block>/*/-->
<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
        return false;
    });
</script>
</body>
</html>